
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户页面</title>
</head>
<body>
    {%for message in get_flashed_messages()%}
    <p style="text-align:center;background:yellow;">{{message}}</p>
    {%endfor%}

    {%if name%}
        <p style="text-align:center;font-size:50px;">当前登陆用户:{{name}}</p>
    {%else%}
        <h1>当前用户未登录</h1>
    {%endif%}

    {%if form%}
    <form method="POST" style="margin: 20px; padding: 20px; border: 1px solid #ccc;text-align:center;">
        {{form.csrf_token}}
        <div>
            {{form.name.label}}<br>
            {{form.name(size=30)}}
            {%if form.name.errors%}
                <ul style="color: red;">
                    {%for error in form.name.errors%}
                        <li>{{error}}</li>
                    {%endfor%}
                </ul>
            {%endif%}
        </div>
        <div style="margin-top: 10px;">
            {{form.submit}}
        </div>
    </form>
    {%endif%}
</body>
</html>

